Adapt arbitrage weight calculations to proof sizes#1120
Merged
sea212 merged 1 commit intorelease-v0.4.0from Sep 23, 2023
Merged
Adapt arbitrage weight calculations to proof sizes#1120sea212 merged 1 commit intorelease-v0.4.0from
sea212 merged 1 commit intorelease-v0.4.0from
Conversation
Codecov ReportPatch coverage:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1120 +/- ##
==========================================
- Coverage 93.53% 93.43% -0.10%
==========================================
Files 95 95
Lines 29137 29552 +415
==========================================
+ Hits 27252 27612 +360
- Misses 1885 1940 +55
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
sea212
added a commit
that referenced
this pull request
Oct 11, 2023
* Update versions to v0.4.0 (#1098) * Update weights (#1101) * Reduce length of `MarketsCollectingSubsidy` (#1118) * Add bad block of the proof size fiasko to Battery Station chain spec (#1119) Add bad block to Battery Station chain spec * Update weights v0.4.0 (#1121) * Update moonbeam dependencies (bench fix) * Update weights * Adapt arbitrage weight calculations to proof sizes (#1120) Include proof size into arbitrage weight estimates --------- Co-authored-by: Malte Kliemann <mail@maltekliemann.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
Previously,$w(a)$ be the weight required for arbitraging $a$ pools. We assume that $w$ is a linear function, $w(a) = ma + b$ . We therefore have $w(1) - w(0) = m + b - b = m$ . Suppose that $W$ is the available weight. Then the maximum number of pools we can arbitrage in the time available is $\frac{W - b}{m}$ (just solve $W = w(a)$ for $a$ ), ignoring the fact that we need to round down to make $a$ an integer.
execute_arbitrage_alldid the following calculation to estimate how many pools can be arbitrages. LetBut weights now have two components, ref time and proof size. The changes in this PR are the following:
on_idleto even do the calculation described above. This is definitely an overestimation, but we should be on the safe side.What important points should reviewers know?
Is there something left for follow-up PRs?
What alternative implementations were considered?
Are there relevant PRs or issues?
References